package cn.dakaqi.dao;

import cn.dakaqi.entities.GroupRecruitVolunteer;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

/**
 * Created by chunyang on 2016/4/19.
 */
public interface GroupRecruitVolunteerDao extends PagingAndSortingRepository<GroupRecruitVolunteer, Long>, JpaSpecificationExecutor<GroupRecruitVolunteer>
{
    @Query(value = "select P from GroupRecruitVolunteer as P where groupRecruit.id =:groupRecruitId and volunteer.id =:volunteerId")
    GroupRecruitVolunteer findByGroupRecuitAndVolunteer(@Param("groupRecruitId") Long groupRecruitId, @Param("volunteerId") Long volunteerId);
}
